From: Florian Müllner Date: Mon, 1 Aug 2022 14:19:43 +0000 (+0200) Subject: status/network: Store sections by device type X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~461^2^2~89 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=392f72bf1c9115cfbcd105d89a0d2add72d1f0af;p=gnome-shell.git status/network: Store sections by device type Now that the indicator no longer needs to map connections to device wrappers, we can drop the custom 'category' type and just use the device type. Part-of: --- diff --git a/js/ui/status/network.js b/js/ui/status/network.js index 5481d7191..148169b46 100644 --- a/js/ui/status/network.js +++ b/js/ui/status/network.js @@ -16,15 +16,6 @@ Gio._promisify(Gio.DBusConnection.prototype, 'call'); Gio._promisify(NM.Client, 'new_async'); Gio._promisify(NM.Client.prototype, 'check_connectivity_async'); -const NMConnectionCategory = { - INVALID: 'invalid', - WIRED: 'wired', - WIRELESS: 'wireless', - BLUETOOTH: 'bluetooth', - WWAN: 'wwan', - VPN: 'vpn', -}; - const MAX_VISIBLE_NETWORKS = 8; var MAX_DEVICE_ITEMS = 4; @@ -1641,10 +1632,10 @@ class Indicator extends PanelMenu.SystemIndicator { this._btSection = new NMBluetoothSection(); this._deviceSections = new Map([ - [NMConnectionCategory.WIRED, this._wiredSection], - [NMConnectionCategory.WIRELESS, this._wirelessSection], - [NMConnectionCategory.WWAN, this._modemSection], - [NMConnectionCategory.BLUETOOTH, this._btSection], + [NM.DeviceType.ETHERNET, this._wiredSection], + [NM.DeviceType.WIFI, this._wirelessSection], + [NM.DeviceType.MODEM, this._modemSection], + [NM.DeviceType.BT, this._btSection], ]); for (const section of this._deviceSections.values()) { section.connectObject(